<!DOCTYPE html PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN" "http://www.w3.org/TR/html4/loose.dtd">
<html>
<head>
    <meta http-equiv="Content-Type" content="text/html; charset=UTF-8">
    <meta name="viewport" content="width=device-width, initial-scale=1.0, maximum-scale=1.0, user-scalable=0;" />
    <title>jasonPayTestDemo</title>
</head>
<body>
<div class="container" id="wechat" style="display: none;">
   <div style="text-align: center;">
       <img src="http://qr.liantu.com/api.php?text=wxp://f2f0-2BxDx2CYr6NPN5MP_024oUVBUbMtNfB">
       <h3>please use wechat, long presh and pay</h3>
   </div>
</div>
</body>
</html>
<script language="javascript">

    var ua = navigator.userAgent.toLowerCase();
    if(ua.match(/MicroMessenger/i)=="micromessenger") {
        goAndPayByWechat();
    } else if(ua.match(/AlipayClient/i)=="alipayclient"){
        goAndPayByAli();
    } else{
        alert("please use wechat or alipay");
    }

    function goAndPayByAli(){
         window.location.href="https://qr.alipay.com/fkx08304gca8slglxkv1qb1";
    }

    function goAndPayByWechat(){
        document.getElementById("wechat").removeAttribute("style");
    }
</script>